# 作者: YYJ
# 2025年08月01日14时58分30秒
# 2486249622@qq.com

# Linux定时任务
"""
crontab -e  #定时任务编辑
40 3 * * * python3 /home/python10/mkdir_day.py  #每天凌晨3:40执行python
"""

import os

# 获取所有文件夹
folders = [folder for folder in os.listdir('home/python10') if os.path.isdir('day')]

if folders:
    # 获取最大文件夹编号
    max_num = max([int(folder[3:]) for folder in folders])
    new_folder = 'day%d' % (max_num + 1)

else:
    new_folder = 'day1'

new_folder_path = os.path.join('home/python10', new_folder)
os.mkdir(new_folder_path)